const Rules = {};
export function RegistRules(key, RuleData) {
    Rules[key] = RuleData;
}


export function GetRules() {
    const PromiseArray = [];
    const KeyArray = [];
    for (const key in Rules) {
        const element = Rules[key];
        PromiseArray.push(element);
        KeyArray.push(key);
    };
    return Promise.all(PromiseArray).then(res => {
        var Rules = {};
        for (let i = 0; i < res.length; i++) {
            const element = res[i];
            Rules[KeyArray[i]] = element.default
        }
        return Rules
    })
}

export default Rules;